package com.neusoft.hifly.rpc.area.dao;

import com.neusoft.hifly.core.pojo.ApiResponse;
import com.neusoft.hifly.rpc.area.dao.fallback.CityFallback;
import com.neusoft.hifly.rpc.area.entity.CityObj;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * Title: 数据字典服务
 * <p>
 * Description: 市信息 Dao
 * <p>
 * Copyright: 2019
 * <p>
 * Company: 东软汉枫
 *
 * @author lijx
 * @version 1.0.0
 */
@FeignClient(value = "ctcloud-cbb-dictionary", fallbackFactory = CityFallback.class)
public interface ICityDao  {

	/**
	 * 根据id查询对象
	 *
	 * @param logicId
	 *            id
	 * @return 对象
	 */
	@GetMapping(value = "/dictionary/api/v1/city/{logicId}")
	ApiResponse<?> getByLogicId(@PathVariable("logicId") long logicId);

	/**
	 * 查询所有对象
	 *
	 * @return 对象集合
	 */
	@GetMapping(value = "/dictionary/api/v1/city/list")
	<T extends List<CityObj>> ApiResponse<T> findAll();

	/**
	 * 通过省份查询城市列表
	 *
	 * @param provLogicId
	 *            省份逻辑ID
	 * @return 集合
	 */
	@GetMapping(value = "/dictionary/api/v1/city/prov/{cityLogicId}")
	<T extends List<CityObj>> ApiResponse<T> findByProvLogicId(@PathVariable("cityLogicId") long provLogicId);

}
